home *** CD-ROM | disk | FTP | other *** search
/ Atari Forever 4 / Atari Forever 4.zip / Atari Forever 4.iso / PD_THEMA / EDITOREN / 7UP_PD / GRAPHICS.H < prev    next >
C/C++ Source or Header  |  1998-03-14  |  7KB  |  351 lines

  1. /*
  2.         GRAPHICS.H
  3.  
  4.         (c) 1992 Pure Software GmbH
  5. */
  6.  
  7.  
  8. #ifndef __GRAPHX_DEF_
  9. #define __GRAPHX_DEF_
  10.  
  11. enum graphics_errors
  12. {
  13.     grOk                =   0,
  14.     grNoInitGraph        =  -1,
  15.     grNotDetected        =  -2,
  16.     grFileNotFound        =  -3,
  17.     grInvalidDriver        =  -4,
  18.     grNoLoadMem            =  -5,
  19.     grNoScanMem            =  -6,
  20.     grNoFloodMem        =  -7,
  21.     grFontNotFound        =  -8,
  22.     grNoFontMem            =  -9,
  23.     grInvalidMode        = -10,
  24.     grError                = -11,
  25.     grIOerror            = -12,
  26.     grInvalidFont        = -13,
  27.     grInvalidFontNum    = -14,
  28.     grInvalidVersion    = -18
  29. };
  30.  
  31. enum graphics_drivers
  32. {
  33.     DETECT,
  34.     CURRENT_DRIVER        = -1,
  35.     CGA,
  36.     MCGA,
  37.     EGA,
  38.     EGA64,
  39.     EGAMONO,
  40.     IBM8514,
  41.     HERCMONO,
  42.     ATT400,
  43.     VGA,
  44.     PC3270,
  45.     VDI                    = 256
  46. };
  47.  
  48. enum graphics_modes
  49. {
  50.     CGAC0                = 0,
  51.     CGAC1                = 1,
  52.     CGAC2                = 2,
  53.     CGAC3                = 3,
  54.     CGAHI                = 4,
  55.     MCGAC0                = 0,
  56.     MCGAC1                = 1,
  57.     MCGAC2                = 2,
  58.     MCGAC3                = 3,
  59.     MCGAMED                = 4,
  60.     MCGAHI                = 5,
  61.     EGALO                = 0,
  62.     EGAHI                = 1,
  63.     EGA64LO                = 0,
  64.     EGA64HI                = 1,
  65.     EGAMONOHI            = 0,
  66.     HERCMONOHI            = 0,
  67.     ATT400C0            = 0,
  68.     ATT400C1            = 1,
  69.     ATT400C2            = 2,
  70.     ATT400C3            = 3,
  71.     ATT400MED            = 4,
  72.     ATT400HI            = 5,
  73.     VGALO                = 0,
  74.     VGAMED                = 1,
  75.     VGAHI                = 2,
  76.     PC3270HI            = 0,
  77.     IBM8514LO            = 0,
  78.     IBM8514HI            = 1,
  79.     VDIMODE                = 0
  80. };
  81.  
  82. #ifndef __COLORS
  83. #define __COLORS
  84.  
  85. enum COLORS
  86. {
  87.     BLACK,
  88.     BLUE,
  89.     GREEN,
  90.     CYAN,
  91.     RED,
  92.     MAGENTA,
  93.     BROWN,
  94.     LIGHTGRAY,
  95.     DARKGRAY,
  96.     LIGHTBLUE,
  97.     LIGHTGREEN,
  98.     LIGHTCYAN,
  99.     LIGHTRED,
  100.     LIGHTMAGENTA,
  101.     YELLOW,
  102.     WHITE
  103. };
  104.  
  105. #endif
  106.  
  107. enum CGA_COLORS
  108. {
  109.     CGA_GREEN            = 2,
  110.     CGA_CYAN            = 3,
  111.     CGA_RED                = 4,
  112.     CGA_MAGENTA            = 5,
  113.     CGA_BROWN            = 6,
  114.     CGA_LIGHTGRAY        = 7,
  115.     CGA_LIGHTGREEN        = 10,
  116.     CGA_LIGHTCYAN        = 11,
  117.     CGA_LIGHTRED        = 12,
  118.     CGA_LIGHTMAGENTA    = 13,
  119.     CGA_YELLOW            = 14,
  120.     CGA_WHITE            = 15
  121. };
  122.  
  123. enum EGA_COLORS
  124. {
  125.     EGA_BLACK            = 0,
  126.     EGA_BLUE            = 1,
  127.     EGA_GREEN            = 2,
  128.     EGA_CYAN            = 3,
  129.     EGA_RED                = 4,
  130.     EGA_MAGENTA            = 5,
  131.     EGA_BROWN            = 6,
  132.     EGA_LIGHTGRAY        = 7,
  133.     EGA_DARKGRAY        = 8,
  134.     EGA_LIGHTBLUE        = 9,
  135.     EGA_LIGHTGREEN        = 10,
  136.     EGA_LIGHTCYAN        = 11,
  137.     EGA_LIGHTRED        = 12,
  138.     EGA_LIGHTMAGENTA    = 13,
  139.     EGA_YELLOW            = 14,
  140.     EGA_WHITE            = 15
  141. };
  142.  
  143. enum line_styles
  144. {
  145.     SOLID_LINE        = 0,
  146.     DOTTED_LINE        = 1,
  147.     CENTER_LINE        = 2,
  148.     DASHED_LINE        = 3,
  149.     USERBIT_LINE    = 4
  150. };
  151.  
  152. enum line_widths
  153. {
  154.     NORM_WIDTH        = 1,
  155.     THICK_WIDTH        = 3
  156. };
  157.  
  158.  
  159. enum font_names
  160. {
  161.     DEFAULT_FONT    = 0,
  162.     TRIPLEX_FONT    = 1,
  163.     SMALL_FONT        = 2,
  164.     SANS_SERIF_FONT    = 3,
  165.     GOTHIC_FONT        = 4
  166. };
  167.  
  168. #define HORIZ_DIR        0
  169. #define VERT_DIR        1
  170.  
  171. #define USER_CHAR_SIZE    0
  172.  
  173. enum fill_patterns
  174. {
  175.     EMPTY_FILL,
  176.     SOLID_FILL,
  177.     LINE_FILL,
  178.     LTSLASH_FILL,
  179.     SLASH_FILL,
  180.     BKSLASH_FILL,
  181.     LTBKSLASH_FILL,
  182.     HATCH_FILL,
  183.     XHATCH_FILL,
  184.     INTERLEAVE_FILL,
  185.     WIDE_DOT_FILL,
  186.     CLOSE_DOT_FILL,
  187.     USER_FILL
  188. };
  189.  
  190. enum putimage_ops
  191. {
  192.     COPY_PUT,
  193.     XOR_PUT,
  194.     OR_PUT,
  195.     AND_PUT,
  196.     NOT_PUT
  197. };
  198.  
  199. enum text_just
  200. {
  201.     LEFT_TEXT        = 0,
  202.     CENTER_TEXT        = 1,
  203.     RIGHT_TEXT        = 2,
  204.     BOTTOM_TEXT        = 0,
  205.     TOP_TEXT        = 2
  206. };
  207.  
  208. #define MAXCOLORS        15
  209.  
  210. struct palettetype
  211. {
  212.     unsigned char    size;
  213.     signed char        colors[MAXCOLORS+1];
  214. };
  215.  
  216. struct linesettingstype
  217. {
  218.     int            linestyle;
  219.     unsigned    upattern;
  220.     int            thickness;
  221. };
  222.  
  223. struct textsettingstype
  224. {
  225.     int        font;
  226.     int        direction;
  227.     int        charsize;
  228.     int        horiz;
  229.     int        vert;
  230. };
  231.  
  232. struct fillsettingstype
  233. {
  234.     int        pattern;
  235.     int        color;
  236. };
  237.  
  238. struct pointtype
  239. {
  240.     int        x;
  241.     int        y;
  242. };
  243.  
  244. struct viewporttype
  245. {
  246.     int        left;
  247.     int        top;
  248.     int        right;
  249.     int        bottom;
  250.     int        clip;
  251. };
  252.  
  253. struct arccoordstype
  254. {
  255.     int        x;
  256.     int        y;
  257.     int        xstart;
  258.     int        ystart;
  259.     int        xend;
  260.     int        yend;
  261. };
  262.  
  263. void    arc( int x, int y, int stangle, int endangle, int radius );
  264. void    bar( int left, int top, int right, int bottom );
  265. void    bar3d( int left, int top, int right, int bottom, int depth, int topflag );
  266. void    circle( int x, int y, int radius );
  267. void    cleardevice( void );
  268. void    clearviewport( void );
  269. void    closegraph( void );
  270. void    detectgraph( int *graphdriver,int *graphmode );
  271. void    drawpoly( int numpoints, int *polypoints );
  272. void    ellipse( int x, int y, int stangle, int endangle, int xradius, int yradius );
  273. void    fillellipse( int x, int y, int xradius, int yradius  );
  274. void    fillpoly( int numpoints, int *polypoints );
  275. void    floodfill( int x, int y, int border );
  276. void    getarccoords( struct arccoordstype *arccoords );
  277. void    getaspectratio( int *xasp, int *yasp );
  278. int        getbkcolor( void );
  279. int        getcolor( void );
  280. char    *getdrivername( void  );
  281. void    *getdefaultpalette( void );
  282. void    getfillpattern( char *pattern );
  283. void    getfillsettings( struct fillsettingstype *fillinfo );
  284. int        getgraphmode( void );
  285. void    getimage( int left, int top, int right, int bottom, void *bitmap );
  286. void    getlinesettings( struct linesettingstype *lineinfo );
  287. int        getmaxcolor( void );
  288. int        getmaxmode( void );
  289. int        getmaxx( void );
  290. int        getmaxy( void );
  291. char    *getmodename( int mode_number );
  292. void    getmoderange( int graphdriver, int *lomode, int *himode );
  293. unsigned int    getpixel( int x, int y );
  294. void    getpalette( struct palettetype *palette );
  295. int        getpalettesize( void );
  296. void    gettextsettings( struct textsettingstype *texttypeinfo );
  297. void    getviewsettings( struct viewporttype *viewport );
  298. int        getx( void );
  299. int        gety( void );
  300. void    graphdefaults( void );
  301. char    *grapherrormsg( int errorcode );
  302. void    _graphfreemem( void *ptr, unsigned size );
  303. void    *_graphgetmem( unsigned size );
  304. int        graphresult( void );
  305. unsigned long    imagesize( int left, int top, int right, int bottom );
  306. void    initgraph( int *graphdriver, int *graphmode, char *pathtodriver );
  307. int        installuserdriver( char *name, int (*detect)( void ));
  308. int        installuserfont( char *name );
  309. void    line( int x1, int y1, int x2, int y2 );
  310. void    linerel( int dx, int dy );
  311. void    lineto( int x, int y );
  312. void    moverel( int dx, int dy );
  313. void    moveto( int x, int y );
  314. void    outtext( char *textstring );
  315. void    outtextxy( int x, int y, char *textstring );
  316. void    pieslice( int x, int y, int stangle, int endangle, int radius );
  317. void    putimage( int left, int top, void *bitmap, int op );
  318. void    putpixel( int x, int y, int color );
  319. void    rectangle( int left, int top, int right, int bottom );
  320. int        registerbgidriver( void (*driver)( void ));
  321. int        registerbgifont( void (*font)( void ));
  322. void    restorecrtmode( void );
  323. void    sector( int X, int Y, int StAngle, int EndAngle, int XRadius, int YRadius );
  324. void    setactivepage( int page );
  325. void    setallpalette( struct palettetype *palette );
  326. void    setaspectratio( int xasp, int yasp );
  327. void    setbkcolor( int color );
  328. void    setcolor( int color );
  329. void    setfillpattern( char *upattern, int color );
  330. void    setfillstyle( int pattern, int color );
  331. unsigned int    setgraphbufsize( unsigned bufsize );
  332. void    setgraphmode( int mode );
  333. void    setlinestyle( int linestyle, unsigned upattern, int thickness );
  334. void    setpalette( int index, int color );
  335. void    setrgbpalette( int colornum, int red, int green, int blue );
  336. void    settextjustify( int horiz, int vert );
  337. void    settextstyle( int font, int direction, int charsize );
  338. void    setusercharsize( int multx, int divx, int multy, int divy );
  339. void    setviewport( int left, int top, int right, int bottom, int clip );
  340. void    setvisualpage( int page );
  341. void    setwritemode( int mode );
  342. int        textheight( char *textstring );
  343. int        textwidth( char *textstring );
  344.  
  345. void    triplex_font( void );
  346. void    small_font( void );
  347. void    sansserif_font( void );
  348. void    gothic_font( void );
  349.  
  350. #endif
  351.